﻿KnowledgedetailtypeInfodetailController = 
App.KnowledgeDetailController = Ember.ObjectController.extend({
    actions: {
        look: function () {
            var model = this.get('model');
            this.transitionTo('knowledgedetailtype.infodetail', model.id);
        },
        del: function () {
            var that = this;
            var model = this.get('model');

            Ember.$.model.del('KnowledgeDetail', model, function (id) {
                that.transitionToRoute('knowledgedetail', CONST.params.knowledgeDetailType_id);
            });
        }
    },
    DisposeType_Name: function (key, value) {
        var model = this.get('model');
        
        var disposeType_ID = model.DisposeType_ID;
        // property being used as a getter
        var json = CONST.DisposeTypes.filter(function (json) {
            return json.id == disposeType_ID;
        })[0];

        return json ? json.Name : '';
    }.property('model.DisposeType_ID')
});

